import request from '../axios/tools'

export const getList = (params) => {
  return request({
    params,
    url: '/api/project?_sort=status',
    method: 'get'
  })
}
export const getListCount = (params) => {
  return request({
    params,
    url: '/api/project/count',
    method: 'get'
  })
}
export const getDoingList = (params) => {
  return request({
    params,
    url: '/api/project?_where=(status,eq,0)',
    method: 'get'
  })
}
export const newList = (params) => {
  return request({
    params,
    url: '/api/project',
    method: 'post'
  })
}
export const editList = (params) => {
  const { id } = params;
  return request({
    params,
    url: `/api/project/${id}`,
    method: 'patch'
  })
}
export const deleteList = (params) => {
  const { id } = params;
  return request({
    url: `/api/project/${id}`,
    method: 'delete'
  })
}